Public Shared Function Hash(ByVal Method As HashMethod, ByVal InputString As String, Optional ByVal HashFormat As String = "x2") As String
        Select Case Method
            Case HashMethod.MD5
                Dim MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
                Dim Buffer As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(InputString)
                Buffer = MD5.ComputeHash(Buffer)
                Dim str As String = Nothing
                For Each Bit As Byte In Buffer
                    str &= Bit.ToString(HashFormat)
                Next
                Return str
            Case HashMethod.SHA512
                Dim Sha As New System.Security.Cryptography.SHA512CryptoServiceProvider
                Dim Buffer As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(InputString)
                Buffer = Sha.ComputeHash(Buffer)
                Dim str As String = Nothing
                For Each Bit As Byte In Buffer
                    str &= Bit.ToString(HashFormat)
                Next
                Return str
            Case HashMethod.SHA1
                Dim GetByte() As Byte = System.Text.Encoding.ASCII.GetBytes(InputString)
                Dim Memory As New MemoryStream
                Memory.Write(GetByte, 0, GetByte.Length - 1)
                Dim hashAlg As SHA1 = SHA1.Create()
                Dim hashvalue() As Byte = hashAlg.ComputeHash(Memory)
                Return Convert.ToBase64String(hashvalue)
            Case HashMethod.SHA256
                Dim ToByte As New StringReader(InputString)
                Dim data() As Byte = System.Text.Encoding.ASCII.GetBytes(ToByte.ReadToEnd())
                Dim shaM As New SHA256Managed()
                Return Convert.ToBase64String(shaM.ComputeHash(data))
            Case HashMethod.SHA384
                Dim GetByte() As Byte = System.Text.Encoding.ASCII.GetBytes(InputString)
                Dim Memory As New MemoryStream
                Memory.Write(GetByte, 0, GetByte.Length - 1)
                Dim hashAlg As SHA384 = SHA384.Create()
                Dim hashvalue() As Byte = hashAlg.ComputeHash(Memory)
                Return Convert.ToBase64String(hashvalue)
        End Select
        Return Nothing
    End Function